{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "11847f51",
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "322d9ea1",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>学生姓名</th>\n",
       "      <th>平时成绩</th>\n",
       "      <th>期中成绩</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>小明</td>\n",
       "      <td>65</td>\n",
       "      <td>95</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>小丽</td>\n",
       "      <td>66</td>\n",
       "      <td>92</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>大强</td>\n",
       "      <td>66</td>\n",
       "      <td>63</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>卡尔</td>\n",
       "      <td>50</td>\n",
       "      <td>33</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "  学生姓名  平时成绩  期中成绩\n",
       "0   小明    65    95\n",
       "1   小丽    66    92\n",
       "2   大强    66    63\n",
       "3   卡尔    50    33"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "演示数据 = pd.read_excel('演示数据.xlsx')\n",
    "演示数据.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "1971f4ed",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'pandas.core.frame.DataFrame'>\n",
      "RangeIndex: 4 entries, 0 to 3\n",
      "Data columns (total 3 columns):\n",
      " #   Column  Non-Null Count  Dtype \n",
      "---  ------  --------------  ----- \n",
      " 0   学生姓名    4 non-null      object\n",
      " 1   平时成绩    4 non-null      int64 \n",
      " 2   期中成绩    4 non-null      int64 \n",
      "dtypes: int64(2), object(1)\n",
      "memory usage: 228.0+ bytes\n"
     ]
    }
   ],
   "source": [
    "演示数据.info()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "66514ea0",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'pandas.core.series.Series'>\n",
      "RangeIndex: 4 entries, 0 to 3\n",
      "Series name: 学生姓名\n",
      "Non-Null Count  Dtype \n",
      "--------------  ----- \n",
      "4 non-null      object\n",
      "dtypes: object(1)\n",
      "memory usage: 164.0+ bytes\n"
     ]
    }
   ],
   "source": [
    "演示数据['学生姓名'].info()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "b034bc6c",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>平时成绩</th>\n",
       "      <th>期中成绩</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>count</th>\n",
       "      <td>4.000000</td>\n",
       "      <td>4.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>mean</th>\n",
       "      <td>61.750000</td>\n",
       "      <td>70.750000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>std</th>\n",
       "      <td>7.847505</td>\n",
       "      <td>29.010056</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>min</th>\n",
       "      <td>50.000000</td>\n",
       "      <td>33.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25%</th>\n",
       "      <td>61.250000</td>\n",
       "      <td>55.500000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>50%</th>\n",
       "      <td>65.500000</td>\n",
       "      <td>77.500000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>75%</th>\n",
       "      <td>66.000000</td>\n",
       "      <td>92.750000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>max</th>\n",
       "      <td>66.000000</td>\n",
       "      <td>95.000000</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "            平时成绩       期中成绩\n",
       "count   4.000000   4.000000\n",
       "mean   61.750000  70.750000\n",
       "std     7.847505  29.010056\n",
       "min    50.000000  33.000000\n",
       "25%    61.250000  55.500000\n",
       "50%    65.500000  77.500000\n",
       "75%    66.000000  92.750000\n",
       "max    66.000000  95.000000"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "演示数据.describe()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "51cab46b",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>学生姓名</th>\n",
       "      <th>平时成绩</th>\n",
       "      <th>期中成绩</th>\n",
       "      <th>总评</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>小明</td>\n",
       "      <td>65</td>\n",
       "      <td>95</td>\n",
       "      <td>160</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>小丽</td>\n",
       "      <td>66</td>\n",
       "      <td>92</td>\n",
       "      <td>158</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>大强</td>\n",
       "      <td>66</td>\n",
       "      <td>63</td>\n",
       "      <td>129</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>卡尔</td>\n",
       "      <td>50</td>\n",
       "      <td>33</td>\n",
       "      <td>83</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "  学生姓名  平时成绩  期中成绩   总评\n",
       "0   小明    65    95  160\n",
       "1   小丽    66    92  158\n",
       "2   大强    66    63  129\n",
       "3   卡尔    50    33   83"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "演示数据['总评'] = 演示数据['平时成绩'] + 演示数据['期中成绩']\n",
    "演示数据"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": ".venv",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.12.10"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
